package com.ios.common.login.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.ios.common.dao.CommonDAO;
import com.ios.common.login.dao.ILoginDAO;
import com.ios.common.pojo.IosSysUser;

@Repository("loginDAO")
public class LoginDAOImpl extends CommonDAO implements ILoginDAO{

	public IosSysUser queryUserInfoByUserCodeAndPassword(String userCode, String password) {
		String hql = "from IosSysUser iosSysUser where iosSysUser.userCode = ? and iosSysUser.password = ?";
		List list = this.getHibernateTemplate().find(hql, new Object[] {userCode, password});
		if (list.isEmpty()) {
			return null;
		} else {
			return (IosSysUser)list.get(0);
		}
	}

}
